<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../style.css">
    </head>
    <body>
        <div class="text">
        <h2>Mini-Ada</h2>
        The program language you can use within this program is a small part of the 
        programming language Ada, called Mini-Ada.<br />
        In the this part you will get a short overview about this language.
        In Ada you should create packages. Therefore there must be three files:<br />
        the package specification (ADS), the definition of the procedure (ADB) 
        and possible test files.
        <br /><br />
        Example of an *.adb:
        <br /><br/>
        <div style="font-family: Courier New;">
PACKAGE BODY IntSqrt IS<br />
&nbsp;&nbsp;&nbsp;PROCEDURE IntSqrtBis (M: OUT Integer; N: in Integer) IS<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Li: Integer;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Re: Integer;<br />
&nbsp;&nbsp;&nbsp;BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--#pre: n = n_anf and n >= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Li := 0;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Re := N;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--#inv: (li**2) <= n and n < (re**2) and li < re<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--#bound: li+1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHILE (Li+1) < Re LOOP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;M := ((Li+Re)/2);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--#Q: (li**2) <= n and n < (re**2) and li < re and m = ((li+re)/2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF (M**2) <= N THEN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Li := M;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELSE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Re := M;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END IF;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END LOOP;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--#post: (i**2) <= n and n < ((i+1)**2)<br />
&nbsp;&nbsp;&nbsp;END IntSqrtBis;<br />
END IntSqrt;
        </div>
<br /><br />
        Example of an *.ads:
        <br /><br />
        <div style="font-family: Courier New;">
PACKAGE IntSqrtBis IS<br />
&nbsp;&nbsp;&nbsp;PROCEDURE IntSqrtBis (M: OUT Integer; N: in Integer);<br />
END IntSqrtBis;
        </div>
        <br />
        <br />
        In general you can use the following structures:
        <ul>
            <li> Assignments </li>
            <li> If-commands </li>
            <li> while-loops </li>
            <li> The types Integer and IntArray, where IntArray is:<br /> 
                TYPE IntArray IS ARRAY (Integer RANGE &lt;&gt;) OF Integer;
            </li>
            <li> Assertion, written as: --#name: a > b AND i** > 5</li>
            <li> Bounds, for each loop: --#BOUND: i**2</li>
            <li> Arithmetic Operators (+, -, *, /, mod, **)</li>
            <li> Logical Junctors (and, or, not, and then, or else) </li>
        </ul>
        For more information regarding the grammar for the Mini-Ada, please take a look
        at the written documentation. You will find the grammar attached.
        </div>
    </body>
</html>
